﻿using DocumentFormat.OpenXml.Lite.Core.Office;
using DocumentFormat.OpenXml.Lite.WordprocessingML.Word.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Samples.Word
{
    class Helloworld
    {
        public static void Create()
        {
            Document doc = DocumentManager.Instance.CreateWordDocument();
            doc.CreateBody().AddParagraph().AddRun().AddSimpleText("Hello world");
            doc.Save(@"samples\helloworld.docx");

            Document parsed = null;
            if (DocumentManager.Instance.OpenWordDocument(@"samples\helloworld.docx", out parsed))
            {
                Console.WriteLine("Sample created and parsed succesfully!");
            }
            Console.ReadLine();
        }
    }
}
